package com.jf.ollama.config;

import io.micrometer.observation.ObservationRegistry;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.model.tool.ToolCallingManager;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.ai.ollama.api.OllamaApi;
import org.springframework.ai.ollama.api.OllamaOptions;
import org.springframework.ai.ollama.management.ModelManagementOptions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2025-06-14
 * Time:1:08
 */
@Configuration
public class MultiModelConfig {
    @Bean
    public ChatModel deepSeekModel() {
        OllamaOptions options = OllamaOptions.builder().model("deepseek-r1:1.5b").build();
        OllamaChatModel  chatModel = new OllamaChatModel(OllamaApi.builder().build(), options, ToolCallingManager.builder().build(), ObservationRegistry.create(), ModelManagementOptions.builder().build());
        return chatModel;
    }
    @Bean
    public ChatModel qwenModel() {
        OllamaOptions options = OllamaOptions.builder().model("qwen2.5vl:3b").build();
        OllamaChatModel  chatModel = new OllamaChatModel(OllamaApi.builder().build(), options, ToolCallingManager.builder().build(), ObservationRegistry.create(), ModelManagementOptions.builder().build());
        return chatModel;
    }
}
